<!DOCTYPE html>
<html>
<head>
	<title>标签</title>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="Bookmark" href="/favicon.ico" >
	<link rel="Shortcut Icon" href="/favicon.ico" />
	<link rel="stylesheet" type="text/css" href="/public/static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="/public/static/h-ui.admin/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="/public/lib/Hui-iconfont/1.0.8/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="/public/static/h-ui.admin/skin/default/skin.css" id="skin" />
	<link rel="stylesheet" type="text/css" href="/public/static/h-ui.admin/css/style.css" />
</head>
<style type="text/css">
	.btn{
		margin-right: 20px;
    	margin-top: 10px;
	}
</style>
<body>
	<div class="codeView docs-example">
		{foreach name="data" item="v"}
		<input class="btn btn-primary radius" type="button" value="{$v.name}" data-value="{$v.id}">
		{/foreach}
	</div>
</body>
<script type="text/javascript" src="/public/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/public/lib/layer/2.4/layer.js"></script>
<script type="text/javascript">
var label_v = parent.$("#label_v").val();
$('.btn').click(function(){
	var name = $(this).val();
	var id = $(this).attr('data-value');
	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
	var html = '<input type="button" value="'+name+'" class="btn btn-primary radius hui-animation" onclick="del_label(this,'+id+')">'
	parent.$("#label").append(html);
	label_v = label_v+','+id+',';
	parent.$("#label_v").val(label_v);

	parent.layer.close(index);
})

</script>
</html>